<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>异步和单线程</title>
</head>
<body>
<div id="btn">
    按钮
</div>
<script>
    var btn = document.getElementById("btn");
    btn.addEventListener("click", () => {
        Promise.resolve().then(() => console.log("Microtask1"))
        console.log("listener 1")
    });

    btn.addEventListener("click", () => {
        Promise.resolve().then(() => console.log("Microtask2"))
        console.log("listener 2")
    });

    btn.click()
</script>
</body>
</html>
